﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ACResultTipData
{
    public List<string> result;
    public string round;
}
public class ChessFightResultTip : MonoBehaviour
{
    public Text round, baseGold, interiseGold, winGold, seriseWinGold, seriseLoseGold;

    private string bundlePath;
    public void Init(string bundlePath, ACResultTipData data)
    {
        this.bundlePath = bundlePath;
        this.round.text = data.round;
        baseGold.text = data.result[0];
        interiseGold.text = data.result[1];
        winGold.text = data.result[2];
        seriseWinGold.text = data.result[3];
        seriseLoseGold.text = data.result[4];

        baseGold.transform.parent.gameObject.SetActive(data.result[0] != "+0");
        interiseGold.transform.parent.gameObject.SetActive(data.result[1] != "+0");
        winGold.transform.parent.gameObject.SetActive(data.result[2] != "+0");
        seriseWinGold.transform.parent.gameObject.SetActive(data.result[3] != "+0");
        seriseLoseGold.transform.parent.gameObject.SetActive(data.result[4] != "+0");

        Destroy(gameObject, 1.5f);
    }
    private void OnDestroy()
    {
        MessageBoxManager.Instance.UnLoadMessageBoxAsset(bundlePath);
    }
}
